package com.huangliusong.hlsinspringboot.bootstrap;

import com.huangliusong.hlsinspringboot.service.CalculatService;
import com.huangliusong.hlsinspringboot.service.Java8CalculatService;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * {@link CalculatService}
 */
@SpringBootApplication(scanBasePackages = "com.huangliusong.hlsinspringboot.service")
public class CalculatServiceBootStrap {
    public static void main(String[] args){
        ConfigurableApplicationContext context=new SpringApplicationBuilder(CalculatServiceBootStrap.class)
                .web(WebApplicationType.NONE).profiles("java8")
                .run(args);

        //HelloWordlBean是否存在
        CalculatService calculatService=context.getBean(CalculatService.class);
        System.out.println("sum="+calculatService.sum(1,2,3,4,5,6,7,8,9,10));

        context.close();

    }
}
